<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE TypeFamilyDependencies, Safe, PolyKinds #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies, TypeOperators, DataKinds, NoImplicitPrelude #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Module      :  Data.Type.Bool</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- License     :  BSD-style (see the LICENSE file in the distribution)</span><span>
</span><span id="line-8"></span><span class="hs-comment">--</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Stability   :  experimental</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Portability :  not portable</span><span>
</span><span id="line-12"></span><span class="hs-comment">--</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Basic operations on type-level Booleans.</span><span>
</span><span id="line-14"></span><span class="hs-comment">--</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- @since 4.7.0.0</span><span>
</span><span id="line-16"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Type.Bool</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-19"></span><span>  </span><span class="annot"><a href="Data.Type.Bool.html#If"><span class="hs-identifier">If</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-keyword">type</span><span> </span><span class="annot"><a href="Data.Type.Bool.html#%26%26"><span class="hs-operator">(&amp;&amp;)</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-keyword">type</span><span> </span><span class="annot"><a href="Data.Type.Bool.html#%7C%7C"><span class="hs-operator">(||)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Type.Bool.html#Not"><span class="hs-identifier">Not</span></a></span><span>
</span><span id="line-20"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Bool.html"><span class="hs-identifier">Data.Bool</span></a></span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span class="hs-comment">-- This needs to be in base because (&amp;&amp;) is used in Data.Type.Equality.</span><span>
</span><span id="line-25"></span><span class="hs-comment">-- The other functions do not need to be in base, but seemed to be appropriate</span><span>
</span><span id="line-26"></span><span class="hs-comment">-- here.</span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span class="hs-comment">-- | Type-level &quot;If&quot;. @If True a b@ ==&gt; @a@; @If False a b@ ==&gt; @b@</span><span>
</span><span id="line-29"></span><span class="hs-keyword">type</span><span> </span><span class="hs-keyword">family</span><span> </span><span id="If"><span class="annot"><a href="Data.Type.Bool.html#If"><span class="hs-identifier hs-var">If</span></a></span></span><span> </span><span id="local-6989586621679506528"><span class="annot"><a href="#local-6989586621679506528"><span class="hs-identifier hs-type">cond</span></a></span></span><span> </span><span id="local-6989586621679506527"><span class="annot"><a href="#local-6989586621679506527"><span class="hs-identifier hs-type">tru</span></a></span></span><span> </span><span id="local-6989586621679506526"><span class="annot"><a href="#local-6989586621679506526"><span class="hs-identifier hs-type">fls</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-30"></span><span>  </span><span id="If"><span class="annot"><a href="Data.Type.Bool.html#If"><span class="hs-identifier hs-var">If</span></a></span></span><span> </span><span id="local-6989586621679506524"><span id="local-6989586621679506525"><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-type">True</span></a></span><span>  </span><span class="annot"><a href="#local-6989586621679506525"><span class="hs-identifier hs-type">tru</span></a></span><span>  </span><span class="annot"><a href="#local-6989586621679506524"><span class="hs-identifier hs-type">fls</span></a></span></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="#local-6989586621679506525"><span class="hs-identifier hs-type">tru</span></a></span><span>
</span><span id="line-31"></span><span>  </span><span id="If"><span class="annot"><a href="Data.Type.Bool.html#If"><span class="hs-identifier hs-var">If</span></a></span></span><span> </span><span id="local-6989586621679506522"><span id="local-6989586621679506523"><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-type">False</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679506523"><span class="hs-identifier hs-type">tru</span></a></span><span>  </span><span class="annot"><a href="#local-6989586621679506522"><span class="hs-identifier hs-type">fls</span></a></span></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="#local-6989586621679506522"><span class="hs-identifier hs-type">fls</span></a></span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-comment">-- | Type-level &quot;and&quot;</span><span>
</span><span id="line-34"></span><span class="hs-keyword">type</span><span> </span><span class="hs-keyword">family</span><span> </span><span id="local-6989586621679506521"><span class="annot"><a href="#local-6989586621679506521"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span id="%26%26"><span class="annot"><a href="Data.Type.Bool.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span></span><span> </span><span id="local-6989586621679506520"><span class="annot"><a href="#local-6989586621679506520"><span class="hs-identifier hs-type">b</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-35"></span><span>  </span><span id="local-6989586621679506519"><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-type">False</span></a></span><span> </span><span id="%26%26"><span class="annot"><a href="Data.Type.Bool.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679506519"><span class="hs-identifier hs-type">a</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-type">False</span></a></span><span>
</span><span id="line-36"></span><span>  </span><span id="local-6989586621679506518"><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-type">True</span></a></span><span>  </span><span id="%26%26"><span class="annot"><a href="Data.Type.Bool.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679506518"><span class="hs-identifier hs-type">a</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="#local-6989586621679506518"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-37"></span><span>  </span><span id="local-6989586621679506517"><span class="annot"><a href="#local-6989586621679506517"><span class="hs-identifier hs-type">a</span></a></span><span>      </span><span id="%26%26"><span class="annot"><a href="Data.Type.Bool.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span></span><span> </span><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-type">False</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-type">False</span></a></span><span>
</span><span id="line-38"></span><span>  </span><span id="local-6989586621679506516"><span class="annot"><a href="#local-6989586621679506516"><span class="hs-identifier hs-type">a</span></a></span><span>      </span><span id="%26%26"><span class="annot"><a href="Data.Type.Bool.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span></span><span> </span><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-type">True</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="#local-6989586621679506516"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-39"></span><span>  </span><span id="local-6989586621679506515"><span class="annot"><a href="#local-6989586621679506515"><span class="hs-identifier hs-type">a</span></a></span><span>      </span><span id="%26%26"><span class="annot"><a href="Data.Type.Bool.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679506515"><span class="hs-identifier hs-type">a</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="#local-6989586621679506515"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">3</span><span> </span><span class="annot"><a href="Data.Type.Bool.html#%26%26"><span class="hs-operator hs-type">&amp;&amp;</span></a></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-comment">-- | Type-level &quot;or&quot;</span><span>
</span><span id="line-43"></span><span class="hs-keyword">type</span><span> </span><span class="hs-keyword">family</span><span> </span><span id="local-6989586621679506514"><span class="annot"><a href="#local-6989586621679506514"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span id="%7C%7C"><span class="annot"><a href="Data.Type.Bool.html#%7C%7C"><span class="hs-operator hs-var">||</span></a></span></span><span> </span><span id="local-6989586621679506513"><span class="annot"><a href="#local-6989586621679506513"><span class="hs-identifier hs-type">b</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-44"></span><span>  </span><span id="local-6989586621679506512"><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-type">False</span></a></span><span> </span><span id="%7C%7C"><span class="annot"><a href="Data.Type.Bool.html#%7C%7C"><span class="hs-operator hs-var">||</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679506512"><span class="hs-identifier hs-type">a</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="#local-6989586621679506512"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-45"></span><span>  </span><span id="local-6989586621679506511"><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-type">True</span></a></span><span>  </span><span id="%7C%7C"><span class="annot"><a href="Data.Type.Bool.html#%7C%7C"><span class="hs-operator hs-var">||</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679506511"><span class="hs-identifier hs-type">a</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-type">True</span></a></span><span>
</span><span id="line-46"></span><span>  </span><span id="local-6989586621679506510"><span class="annot"><a href="#local-6989586621679506510"><span class="hs-identifier hs-type">a</span></a></span><span>      </span><span id="%7C%7C"><span class="annot"><a href="Data.Type.Bool.html#%7C%7C"><span class="hs-operator hs-var">||</span></a></span></span><span> </span><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-type">False</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="#local-6989586621679506510"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-47"></span><span>  </span><span id="local-6989586621679506509"><span class="annot"><a href="#local-6989586621679506509"><span class="hs-identifier hs-type">a</span></a></span><span>      </span><span id="%7C%7C"><span class="annot"><a href="Data.Type.Bool.html#%7C%7C"><span class="hs-operator hs-var">||</span></a></span></span><span> </span><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-type">True</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-type">True</span></a></span><span>
</span><span id="line-48"></span><span>  </span><span id="local-6989586621679506508"><span class="annot"><a href="#local-6989586621679506508"><span class="hs-identifier hs-type">a</span></a></span><span>      </span><span id="%7C%7C"><span class="annot"><a href="Data.Type.Bool.html#%7C%7C"><span class="hs-operator hs-var">||</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679506508"><span class="hs-identifier hs-type">a</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="#local-6989586621679506508"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">2</span><span> </span><span class="annot"><a href="Data.Type.Bool.html#%7C%7C"><span class="hs-operator hs-type">||</span></a></span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-comment">-- | Type-level &quot;not&quot;. An injective type family since @4.10.0.0@.</span><span>
</span><span id="line-52"></span><span class="hs-comment">--</span><span>
</span><span id="line-53"></span><span class="hs-comment">-- @since 4.7.0.0</span><span>
</span><span id="line-54"></span><span class="hs-keyword">type</span><span> </span><span class="hs-keyword">family</span><span> </span><span id="Not"><span class="annot"><a href="Data.Type.Bool.html#Not"><span class="hs-identifier hs-var">Not</span></a></span></span><span> </span><span id="local-6989586621679506507"><span class="annot"><a href="#local-6989586621679506507"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621679506506"><span class="annot"><a href="#local-6989586621679506506"><span class="hs-identifier hs-type">res</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="#local-6989586621679506506"><span class="hs-identifier hs-type">res</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679506507"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-55"></span><span>  </span><span id="Not"><span class="annot"><a href="Data.Type.Bool.html#Not"><span class="hs-identifier hs-var">Not</span></a></span></span><span> </span><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-type">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-type">True</span></a></span><span>
</span><span id="line-56"></span><span>  </span><span id="Not"><span class="annot"><a href="Data.Type.Bool.html#Not"><span class="hs-identifier hs-var">Not</span></a></span></span><span> </span><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-type">True</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">'</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-type">False</span></a></span><span>
</span><span id="line-57"></span></pre></body></html>